Carousel Template
Carousel Messaging: A new messaging template named Carousel is been released, which allow user to send a single text message, accompanied by a set of up to 10 carousel cards in a horizontally scrollable view. Cards must have a media header (image or video), body text and at least one button. At max 2 buttons can be supported on any particular card, which can be the same or a mix of quick reply buttons, phone number buttons, or URL buttons.
Uses:
- It can be used to demonstrate new products
- Share multiple products in a single message- ( a new collection of Products)
- Share Property Images with the WA user
Send Carousel message:
payload
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "<TO>",
"type": "template",
"template": {
"name": "<TEMPLATE_NAME>",
"language": {
"code": "<TEMPLATE_LANGUAGE_CODE>"
},
"components": [
{
"type": "BODY",
"parameters": [
{
"type": "TEXT",
"text": "<BUBBLE_TEXT_VARIABLE>"
}
]
},
{
"type": "CAROUSEL",
"cards": [
{
"card_index": 0,
"components": [
{
"type": "HEADER",
"parameters": [
{
"type": "IMAGE",
"image": {
"id": "<HEADER_ASSET_ID>"
}
},
{
"type": "VIDEO",
"video": {
"id": "<HEADER_ASSET_ID>"
}
}
]
},
{
"type": "BODY",
"parameters": [
{
"type": "text",
"text": "<CARD_BODY_VARIABLE>"
}
]
},
{
"type": "BUTTON",
"sub_type": "QUICK_REPLY",
"index": "<BUTTON_INDEX>",
"parameters": [
{
"type": "PAYLOAD",
"payload": "<QUICK_REPLY_BUTTON_PAYLOAD>"
}
]
},
{
"type": "BUTTON",
"sub_type": "URL",
"index": "<BUTTON_INDEX>",
"parameters": [
{
"type": "PAYLOAD",
"payload": "<URL_BUTTON_PAYLOAD>"
}
]
}
]
},
{
"card_index": 1,
"components": [
{
"type": "HEADER",
"parameters": [
{
"type": "IMAGE",
"image": {
"id": "<HEADER_ASSET_ID>"
}
},
{
"type": "VIDEO",
"video": {
"id": "<HEADER_ASSET_ID>"
}
}
]
},
{
"type": "BODY",
"parameters": [
{
"type": "text",
"text": "<CARD_BODY_VARIABLE>"
}
]
},
{
"type": "BUTTON",
"sub_type": "QUICK_REPLY",
"index": "<BUTTON_INDEX>",
"parameters": [
{
"type": "PAYLOAD",
"payload": "<QUICK_REPLY_BUTTON_PAYLOAD>"
}
]
},
{
"type": "BUTTON",
"sub_type": "URL",
"index": "<BUTTON_INDEX>",
"parameters": [
{
"type": "PAYLOAD",
"payload": "<URL_BUTTON_PAYLOAD>"
}
]
}
]
}
]
}
]
},
"metadata": {
"channel": "wa",
"callbackDlrUrl": "https://webhook.site/",
"transactionId": "abcd",
"messageId": "msg-1"
}
}
It consists of followings things-
- Message Bubble- Mandatory Field - Variables can be optional on the same.
- Carousel Cards- It consist of Header, Body and Button component. Header component can consist of Image/Video Media file, Body consist of text with variables, Button consist of upto 2 buttons- Quick Reply URL and Phone number.
Parameters
Placeholder | Description | Sample Value |
---|---|---|
BUBBLE_TEXT_VARIABLE String | Required if the message bubble uses variables. Message bubble text variable. There is no maximum character limit on this value, but counts against the message bubble limit of 1024 characters. | 20OFF |
BUTTON_INDEX Integer | Required. Zero-indexed order in which button appears at the bottom of the template message. 0 indicates the first button, 1 indicates second button, etc. | 0 |
CARD_INDEX Integer | Required. Zero-indexed order in which card appears within the card carousel. 0 indicates first card, 1 indicates second card, etc. | 0 |
CARD_BODY_VARIABLE String | Required if card body text uses a variable. Card body text variable. There is no maximum character limit on this value, but counts against the card body text limit of 160 characters. | 20OFF |
HEADER_ASSET_ID Media asset handle. | Required. Uploaded media ID. | 1323649805780 |
QUICK_REPLY_BUTTON_PAYLOAD String | Optional. Value to be included in messages webhooks (messages.button.payload) when the button is tapped. | 1323649805780 |
QUICK_REPLY_BUTTON_PAYLOAD String | Optional. Value to be included in messages webhooks (messages.button.payload) when the button is tapped. | 59NqSd |
TEMPLATE_LANGUAGE_CODE Enum | Required. Language and locale code of the template to be sent in the template message. | En_US |
TEMPLATE_NAME String | Required. Name of the template to be sent in the template message. | Template_1 |
TO String | Required. Phone number of customer to whom the template message should be sent to. | 7890XXXXXX |
URL_BUTTON_PAYLOAD String | Required if the URL button uses a variable.URL button variable value. | last_chance_2023 |
Meta Data Object- (optional)
S.No | Parameter | R/O | Description |
---|---|---|---|
1 | messageId | O | Field to be passed for identification of message, limit upto 50 characters. |
2 | transactionId | O | This is a unique id, provided to enterprise from Sinch India when any customer send any message to enterprises. To be passed as it is if responding to a message in conversation. |
3 | callbackDlrUrl | O | The URL on which enterprise required the DLRs of the messages. |
4 | channel | O | Fixed Value- wa. |
Note: - For uploading media files, Please refer 'Upload Media' section.